// order_status.dart

class OrderOilStatus {
  const OrderOilStatus._();

  static const int PAYING = 2; // 支付中(支付了一部分，混合支付)
  static const int WAIT_PAY = 1010; // 待支付(未销单)
  static const int LOCK = 1020; // 锁单
  static const int DONE = 1030; // 支付完成(已销单)
  static const int CANCEL = 1040; // 已取消
  static const int ABANDON = 2010; // 弃单
  static const int BACK = 2020; // 回灌
  static const int BACK_ERROR = 2030; // 回灌错误
  static const int EMPTY_ERROR = 2040; // 空枪数据
  static const int PROCESS_FAIL = 3010; // 处理失败

  // 获取描述
  static String getDesc(int status) {
    switch (status) {
      case WAIT_PAY:
        return "待支付";
      case LOCK:
        return "已锁定";
      case DONE:
        return "已销单";
      case CANCEL:
        return "已取消";
      case ABANDON:
        return "弃单";
      case BACK:
        return "回灌";
      case BACK_ERROR:
        return "错误数据";
      case EMPTY_ERROR:
        return "空枪数据";
      case PROCESS_FAIL:
        return "处理失败";
      case PAYING:
        return "支付中";
      default:
        return "未知状态";
    }
  }

  // 获取数组
  // static List<int> getValues() {
  //   return [
  //     WAIT_PAY,
  //     LOCK,
  //     DONE,
  //     CANCEL,
  //     ABANDON,
  //     BACK,
  //     BACK_ERROR,
  //     EMPTY_ERROR,
  //     PROCESS_FAIL,
  //     PAYING,
  //   ];
  // }
}

class OrderPayStatus {
  const OrderPayStatus._();

  static const int UNPAID = 1010; // 待支付
  static const int PAYING = 1020; // 支付中
  static const int FINISH = 1030; // 交易完成
  static const int CANCEL = 1040; // 订单取消
  // ---------- 支付状态 ----------
  static const int UNPAID_PAY = 2010; // 待支付
  static const int PAYING_PAY = 2020; // 支付中
  static const int SUCCESS_PAY = 2030; // 支付成功
  static const int FAIL_PAY = 2040; // 支付失败
  static const int CANCEL_PAY = 2050; // 支付取消
  // ---------- ↑↑↑↑↑↑↑↑ ----------
  static const int UNCONFIRMED = 3010; // 交易成功退款，待审核
  static const int REFUNDING = 3040; // 交易成功，已同意退款
  static const int REFUSE = 3050; // 交易成功，拒绝退款
  static const int FAILURE = 3060; // 支付渠道退款失败、商户退款失败
  static const int PART_REFUNDED = 3070; // 部分已退款
  static const int REFUNDED = 3080; // 全部退款
  static const int UNDELIVERED = 4010; // 待发货
  static const int UNSIGNED = 4020; // 待确认收货 （自提单，直接为此状态）
  static const int SIGNED = 4030; // 已确认收货
  static const int WAIT_DELIVERY = 4040; // 待收货
  static const int SIGNED_FOR = 4050; // 已签收
  static const int DELIVERY_FAILED = 4060; // 发货失败

  // 获取数组
  static List<int> getValues() {
    return [
      // UNPAID,
      PAYING,
      FINISH,
      CANCEL,
      // UNPAID_PAY,
      // PAYING_PAY,
      // SUCCESS_PAY,
      // FAIL_PAY,
      // CANCEL_PAY,
      // UNCONFIRMED,
      // REFUNDING,
      // REFUSE,
      // FAILURE,
      // PART_REFUNDED,
      REFUNDED,
      // UNDELIVERED,
      // UNSIGNED,
      // SIGNED,
      // WAIT_DELIVERY,
      // SIGNED_FOR,
      // DELIVERY_FAILED,
    ];
  }

  static String getDesc(int? status) {
    switch (status) {
      case UNPAID:
        return "待支付";
      case PAYING:
        return "支付中";
      case FINISH:
        return "交易完成";
      case CANCEL:
        return "已取消";
      case UNPAID_PAY:
        return "待支付";
      case PAYING_PAY:
        return "支付中";
      case SUCCESS_PAY:
        return "已支付";
      case FAIL_PAY:
        return "支付失败";
      case CANCEL_PAY:
        return "支付取消";
      case UNCONFIRMED:
        return "待处理";
      case REFUNDING:
        return "退款中";
      case REFUSE:
        return "拒绝退款";
      case FAILURE:
        return "退款失败";
      case PART_REFUNDED:
        return "部分已退款";
      case REFUNDED:
        return "已退款";
      case UNDELIVERED:
        return "待发货";
      case UNSIGNED:
        return "待取货";
      case SIGNED:
        return "已完成";
      case WAIT_DELIVERY:
        return "待收货";
      case SIGNED_FOR:
        return "已签收";
      case DELIVERY_FAILED:
        return "发货失败";
      default:
        return "未知状态[$status]";
    }
  }
}
